/**
 * Date:2017年12月25日上午11:09:32
 *
 */

package com.xue.action;

import java.time.LocalDateTime;
import java.util.Map;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: demo <br/>
 * Date: 2017年12月25日 上午11:09:32 <br/>
 * 
 * @author xuejianxinokok@163.com
 */

@RequestMapping(value = DemoController.PATH)
@RestController("demoController")
public class DemoController {
	public static final String PATH = "/";
	private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(DemoController.class);

	@RequestMapping("admin/hello")
	public String admin() {
		return "hello admin!";
	}

	@RequestMapping("user/hello")
	public String user() {
		return "hello user";
	}

	@RequestMapping("/")
	public String hello() {
		return "hello";
	}

	@PostMapping("demo/post/hello")
	public Map<String, Object> hello(@RequestBody Map<String, Object> ps) {
		System.out.println(ps);
		ps.put("time", LocalDateTime.now());
		ps.put("source", "java");
		return ps;
	}

}
